package com.hjrpc.babyyamall.product.vo;

import com.hjrpc.babyyamall.product.entity.SkuImagesEntity;
import com.hjrpc.babyyamall.product.entity.SkuInfoEntity;
import com.hjrpc.babyyamall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.util.List;

@Data
@ToString
public class SkuItemVo {
    // 是否有货
    private boolean hasStock = true;

    // sku基本信息
    private SkuInfoEntity skuInfo;

    // sku的图片信息
    private List<SkuImagesEntity> images;

    // spu的描述信息
    private SpuInfoDescEntity spuInfoDesc;

    // spu的分组信息
    private List<SpuItemAttrGroup> groups;

    // sku的销售属性
    private List<SpuItemSaleAttr> saleAttrs;

    @Data
    @ToString
    public static class SpuItemAttrGroup{
        private String groupName;
        private List<SkuGroupBaseAttr> baseAttrs;
    }

    @Data
    @ToString
    public static class SpuItemSaleAttr {
        private Long attrId;
        private String attrName;
        private List<SaleAttrValueWithSkuId> attrValues;
    }

    @Data
    @ToString
    public static class SaleAttrValueWithSkuId{
        private String attrValue;
        private String skuIds;
    }

    @Data
    @ToString
    public static class SkuGroupBaseAttr {
        private String attrName;
        private String attrValue;
    }
}
